import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  mode: 'history', //HTML5 History 模式,不丑的URL,需要后端配置
  routes: [
    {
      path: '/',
      name: 'Nav',
      component: resolve => require(['@/components/Nav'], resolve),
      redirect: {name: 'Indoor'},
      children: [{
        path: 'indoor',
        name: 'Indoor',
        component: resolve => require(['@/components/Indoor'], resolve),
      }, {
        path: 'outdoor',
        name: 'Outdoor',
        component: resolve => require(['@/components/Outdoor'], resolve),
      }, {
        path: 'weather',
        name: 'Weather',
        component: resolve => require(['@/components/Weather'], resolve),
      }, {
        path: 'soil',
        name: 'Soil',
        component: resolve => require(['@/components/Soil'], resolve),
      },/* {
        path: 'sevendaydata',
        name: 'Sevendaydata',
        component: resolve => require(['@/components/Sevendaydata'], resolve),
      },*/ {
        path: 'setting',
        name: 'Setting',
        component: resolve => require(['@/components/Setting'], resolve),
      }/*, {
        path: 'example',
        name: 'Example',
        component: resolve => require(['@/components/Example'], resolve)
      }, {
        path: 'test',
        name: 'Test',
        component: resolve => require(['@/components/Test'], resolve)
      }*/]
    }
  ]
})
